CMAKE_MINIMUM_REQUIRED(VERSION 3.15 FATAL_ERROR)
PROJECT(Gall VERSION 2020.5.3 LANGUAGES CXX)

INCLUDE_DIRECTORIES(./Include/)

ADD_EXECUTABLE(Gall
        Source/Gall/Gall.cpp
        Source/Loader/PNG.cpp
        Source/Amoxe/Image.cpp
        Source/Amoxe/Readable.cpp
        Source/Amoxe/Writable.cpp)

SET_TARGET_PROPERTIES(Gall PROPERTIES CXX_STANDARD 17)

# We depend upon zlib
FIND_PACKAGE(ZLIB REQUIRED)
IF (ZLIB_FOUND)
    INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
    TARGET_LINK_LIBRARIES(Gall PRIVATE ${ZLIB_LIBRARIES})
ENDIF ()

# We also depend upon libpng
FIND_PACKAGE(PNG REQUIRED)
INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(Gall PRIVATE ${PNG_LIBRARIES})

ADD_EXECUTABLE(TestImagesSHA Test/TestImagesSha.cpp)
SET_TARGET_PROPERTIES(TestImagesSHA PROPERTIES CXX_STANDARD 17)

FIND_PACKAGE(Boost 1.71 REQUIRED)
TARGET_LINK_LIBRARIES(TestImagesSHA LINK_PUBLIC ${BOOST_LIBRARIES} pthread)